package com.june.springmvc.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.june.springmvc.pojo.;
import com.june.springmvc.service.Service;
import com.june.springmvc.mapper.Mapper;

@Service
@Transactional
public class ServiceImpl implements Service {

	@Autowired
	private Mapper Dao;

	@Override
	public  save( ) {
		Dao.insertSelective();
		return ;
	}

	@Override
	public List<> save(List<> s) {
		for (  : s) {
			Dao.insertSelective();
		}
		return s;
	}

	@Override
	public void delete( ) {
		Dao.deleteByPrimaryKey(.getId());
	}
	
	@Override
	public void batchDelete(String[] ids){
		for(String id : ids){
			Dao.deleteByPrimaryKey(Integer.valueOf(id));
		}
	}

	@Override
	public  findOne( ) {
		return Dao.selectByPrimaryKey(.getId());
	}
	
	@Override
	public List<> findPageData( pojo,Integer pageNumber,Integer pageSize) {
		return Dao.selectPageBySelective(pojo, (pageNumber-1)*pageSize, pageSize);
	}

	@Override
	public Integer selectCount( ) {
		return Dao.selectCount();
	}

}
